package com.cosmoplat.xikai.business.controller;

import com.cosmoplat.xikai.business.domain.vo.DeviceStatusVo;
import com.cosmoplat.xikai.business.service.DeviceCallService;
import com.cosmoplat.xikai.common.core.controller.BaseController;
import com.cosmoplat.xikai.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ScreenController
 * @Description 大屏接口
 * @Author wdf
 * @Date 2025/2/6
 */
@Api(tags = "大屏接口", value = "大屏接口")
@RestController
@Slf4j
@RequestMapping("/screen")
public class ScreenController extends BaseController {


    @Autowired
    private DeviceCallService deviceCallService;

    @Value("${device.code}")
    private String deviceCode;

    @ApiOperation(value = "获取设备状态")
    @GetMapping("/getDeviceStatus")
    public AjaxResult<DeviceStatusVo> getDeviceStatus() {
        return AjaxResult.success(deviceCallService.getDeviceStatus(deviceCode));
    }
}
